<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="java.util.List" %>
<%@ page import="com.knowledge.model.Reply" %>
<%
	String fApplyCount = (String)request.getAttribute("fApplyCount");
	String userId = (String)request.getAttribute("userId");
	List<Reply> replyList = (List<Reply>)request.getAttribute("replyList");	
	if((! fApplyCount.equals("0"))|| (replyList != null)){
%>

<div id="replyDiv">
	<div>
		<span style="position:relative;float:left;left:12px;">
			<h2>新请求及回复</h2>
		</span>
		<span style="postion:relative;float:right;right:12px">
			<a href="/myreplylist.do">更多</a>
		</span>
	</div>
	<div style="clear:both;"></div>
	<hr/>
	<div id="replylist">

	<%	if(! fApplyCount.equals("0")){ %>
		<div id="applyCount">
			<span class="title">
				<a href="requests.jsp?userId=<%=userId%>"><%= fApplyCount%></a>
				个好友申请
			</span>
			<span><a class="x-to-hide" href="javascript:hiddenAppCount('applyCount');"></a></span>
		</div>
	<%	}
		if(replyList != null){
			for(Reply reply : replyList){ 
	%>
		<div id="replylist<%=reply.getId()%>">
			<span class="title">
				<a href="profile.aciton?userId=<%=reply.getReplierId()%>">
					<%=reply.getReplier() %>
				</a>在您的知识
				<a href="viewknowledge.action?knowledgeId=<%=reply.getKnowledgeId() %>&userId=<%=reply.getUserId() %>&user=own" onClick="<%="delReplyList("+userId+","+reply.getKnowledgeId()+")"%>">
					<%=reply.getTitle() %>
				</a> 里留言了
			</span>
			<span><a class="x-to-hide" href="javascript:hiddenDiv('replylist','<%=reply.getId()%>');"></a></span>
		</div>
	<%		}
		}
	%>
	</div>
</div>
<%	} %>

<script language="javascript">
function delReplyList(userId,knowledgeId){
	$.post("delreplylist.action",{userId:userId,knowledgeId:knowledgeId});
}
</script>